package com.sistemagestion.BO;

import java.util.List;

import com.sistemagestion.DAO.ClienteRepository;
import com.sistemagestion.Entities.Cliente;

public class ClienteBO {

	private ClienteRepository repository = new ClienteRepository();
	
	public List<Cliente> getAll(){
		return repository.getAll();
	}
	
	public long saveCliente(Cliente cli)
	{
		if (cli != null)
			return repository.saveObject(cli);
		else
			return 0;
	}
	public Cliente getById(int IdCliente)
	{
		try 
		{
			return repository.getById(IdCliente);
		}
		catch(Exception ex)
		{
			return null;
		}
	}
	
	public void Eliminar (Cliente cli){
		try
		{
		repository.delete(cli);
		}
		catch (Exception e) {
		}
	}
	
}
